Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call serial_free when Serial object is destroyed #2243

Closed
wants to merge 2 commits into from

Conversation

mmahadevan108
Copy link
Contributor

Signed-off-by: Mahadevan Mahesh [email protected]

@mmahadevan108
Copy link
Contributor Author

@geky

@geky
Copy link
Contributor

geky commented Jul 25, 2016

Looks good to me 👍, we'll just have to let CI run.

previous pr: #1653
cc @0xc0170

@sg-
Copy link
Contributor

sg- commented Jul 25, 2016

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,NRF51_DK,NRF51_MICROBIT,NUCLEO_F411RE

@sg-
Copy link
Contributor

sg- commented Jul 25, 2016

/morph test

@mbed-bot
Copy link

[Build ${MBED_BUILD_ID}]
FAILURE: Something went wrong when building and testing.

@sg-
Copy link
Contributor

sg- commented Jul 25, 2016

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,NRF51_DK,NRF51_MICROBIT,NUCLEO_F411RE

@mbed-bot
Copy link

[Build 697]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 514

Test failed!

@bridadan
Copy link
Contributor

The bot response is a bit misleading, sorry about that. The actual failure occurred in the build. The following targets failed to build for all three toolchains: MAX32600MBED and MAXWSNENV.

They each fail when linking tests with the following error:

ARM

16:02:22 Building project features-frameworks-utest-tests-unit_tests-test_setup_failure (MAXWSNENV, ARM)
16:02:22 Scan: ARM
16:02:22 Scan: test_setup_failure
16:02:23 Compile: main.cpp
16:02:23 Link: features-frameworks-utest-tests-unit_tests-test_setup_failure
16:02:23 Error: L6218E: Undefined symbol serial_free (referred from SerialBase.o).

GCC_ARM

16:03:55 Building project features-frameworks-utest-tests-unit_tests-test_setup_failure (MAXWSNENV, GCC_ARM)
16:03:55 Scan: GCC_ARM
16:03:55 Scan: test_setup_failure
16:03:56 Compile: main.cpp
16:03:56 Link: features-frameworks-utest-tests-unit_tests-test_setup_failure
16:03:56 C:/Jenkins/workspace/bm_wrap/156/.build/tests/MAXWSNENV/GCC_ARM/hal/common/SerialBase.o: In function `mbed::SerialBase::~SerialBase()':
16:03:56 SerialBase.cpp:(.text._ZN4mbed10SerialBaseD2Ev+0xa): undefined reference to `serial_free'
16:03:56 collect2.exe: error: ld returned 1 exit status

IAR

15:59:43 Building project features-frameworks-utest-tests-unit_tests-test_setup_failure (MAX32600MBED, IAR)
15:59:43 Scan: IAR
15:59:43 Scan: test_setup_failure
15:59:44 Compile: main.cpp
15:59:44 Link: features-frameworks-utest-tests-unit_tests-test_setup_failure
15:59:44 Error[Li005]: no definition for "serial_free" [referenced from C:\Jenkins\works
15:59:44           pace\bm_wrap\156\.build\tests\MAX32600MBED\IAR\hal\common\SerialBase.
15:59:44           o]

@geky
Copy link
Contributor

geky commented Jul 25, 2016

@bridadan, that's very interesting. Is this a bug with the target implementations?

It looks like the MAXWSNENV/MAX32600MBED have simply not implemented the serial_free function.

@bridadan
Copy link
Contributor

@geky Yup I looks like that's the issue!

@sg-
Copy link
Contributor

sg- commented Jul 26, 2016

just need to add some implementation there for the targets

@sg-
Copy link
Contributor

sg- commented Jul 26, 2016

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 528

Test failed!

@sg-
Copy link
Contributor

sg- commented Jul 26, 2016

@0xc0170

@sg-
Copy link
Contributor

sg- commented Jul 26, 2016

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,NRF51_DK,NRF51_MICROBIT,NUCLEO_F411RE

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 26, 2016

Let's integrate this.

Future request, we might or not consider rule of 3 for SerialBase (I think this question was asked earlier in the previous PR), and document what is expected from serial_free as part of HAL.
Plus those empty functions for those targets, either implement right away or create an issue and notify owners that this shall be implemented.

@mbed-bot
Copy link

[Build 717]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@sg-
Copy link
Contributor

sg- commented Jul 27, 2016

Looks like this caused a testing regression. Probably due to fflush not complete on dtor (guess) in the test cases. Need to hold on this one and investigate further.

@mmahadevan108
Copy link
Contributor Author

Any update?

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 24, 2016

Any update?

This needs more than just a destructor. Serial handles resources, and we shall not destroy them just like that. We allow copy of Serial for instance, therefore creating a copy of Serial object, and destructing the old copy would lead to undefined behaviour (the new copy would use an object that might not be valid anymore - peripheral already disabled). We should provide a guideline for lifetime of objects.

We will keep you updated.

@mmahadevan108
Copy link
Contributor Author

Thanks for your reply. The change does nothing new for implementations that have any empty serial_free() implementation.

It is only for the benefit of platforms that have some cleanup needed and has it implemented in serial_free() hal api.

@theotherjimmy
Copy link
Contributor

Please reopen when unblocked.

@mmahadevan108 mmahadevan108 deleted the Serial_Update branch August 20, 2019 18:24
artokin pushed a commit to artokin/mbed-os that referenced this pull request Feb 20, 2020
…..fb7413b

fb7413b Merge branch 'release_internal' into release_external
a9f6e88 Merge branch 'master' into release_internal
c536960 DHCPv6 Server feature update
01e7e82 Merge pull request ARMmbed#2314 from ARMmbed/update_from_mbedos
c906c43 Fixed typo: 'lenght' in ns_crc.h
2bd0558 Wi-sun border router DHCPv6 server address alocation update
63e4680 Allow buffer_dyn to handle more data (ARMmbed#2311)
9b82abf Copy IE unicast channel function from WS info instead of FHSS configu… (ARMmbed#2310)
18247d5 Wi-sun RPL memory soft and hard limit update
c8560db Updated RPL default memory sof and hard limit to 2/4 from 1/2.
05aa54c Update MPL parameters to follow Specification
f728d55 Support for handle CRC error which will automatically change a channel.
6b6f535 Corrected EUI-64 address bit flip on supplicant
015f3fe Corrected bitfield definition
7717ef8 Improved initial EAPOL-key send stop logic on supplicant
4185734 Improved EAPOL key update retry logic
8bda176 Wi-sun boot fix
6283dfd DIO advertisment fix
1acec7c Aro Registation and Dao update
6cde17a Iotthd 3963 2 (ARMmbed#2301)
b9187da Randomize fixed channel when making new parent selection
34d0339 Wi-sun address registartion update
5b30559 Allow unicast TX to overlap with MC (ARMmbed#2298)
d40b1c7 MAC: Updated calling FHSS TX done (ARMmbed#2295)
aeb93a1 Add support for bbr configuration that removes default route from DIO
9b941af Use default UC channel function in discovery, fixed BC schedule (ARMmbed#2284)
d65fcc6 Fix Wi-SUN network name comparison (ARMmbed#2294)
f085132 Made parent set size configuraple in RPL
fd11ffa Added HAVE_WS flag to FHSS api (ARMmbed#2296)
4f27500 Implemented optimal packet size test api (ARMmbed#2292)
87ee16a Call channel change after filtered out packet
d196ffc Refactor Wi-SUN BBR stop function
35970d7 Revert "Disabled temporarily tx slot check for testing purposes (ARMmbed#2287)" (ARMmbed#2289)
8cc0ff5 Disabled temporarily tx slot check for testing purposes (ARMmbed#2287)
e306dc5 Removed extra ";"
5642a4f Free TX failed list when FHSS deleted (ARMmbed#2285)
9fcf718 Updated FHSS optimal packet length to 300 bytes (ARMmbed#2282)
427743f ETX and Source route validation update
7b6bcca Added TX/RX bytes in PHY statistics (ARMmbed#2281)
a043f8d Wi-sun FHSS Management update
2ff90e6 Configure TXRX slot length using given datarate (ARMmbed#2275)
a126cb7 ETX sampling rule update
d5cf8d5 Clean ARMC6/GCC compiler warnings (ARMmbed#2278)
807632d DHCP server freed next free allocated id
fd6ce04 Thread Child ml16 update clear old address queue's and registered address.
99e6efa Neighbour remove operation update
5cd094c Corrected GTK update initial EAPOL-key trickle timer
7606ee8 Wi-sun NS Aro registration blacklisting update
e3e5a00 Timed parent selection timer trigger update
7144121 RPL DIO Multicast message update
588f202 Wi-Sun RPL bootstrap update
20289f6 Added periodic RPL version number increase
d8dd18d Added ignoring of incoming security messages and improved EAP-TLS startup
7350634 Corrected initial EAPOL-key trickle retries
ac33518 Wi-sun ETX and proping update
11c486f Implemented unregistering FHSS from MAC. FHSS deleted in ifdown call. (ARMmbed#2266)
eabca17 Wi-Sun Border router DHCPV server SLAAC mode enabled by default.
1d6ce9c DHCPv6 Server feature update
46aa460 Fixed unit test's.
c65292e Mac enhanced ACK pending update
11a1e1d Store TX start channel and black list if TX failed (ARMmbed#2261)
0494606 Adapatation layer unicast list entry free update
4481e86 Updated trace level to info.
c9e3d8e Interface down update
1f77ad6 Updated trace levels (ARMmbed#2258)
1d82fd5 Wi-sun BBR route update fix
33c48eb Removed NUD messages from registered children
ec2ea92 Added RX and TX active times in PHY statistics (ARMmbed#2255)
49686cc Wi-sun certification test setup update
1090430 Trickle API update and Wi-SUN config sol state timeout update
38df576 Wi-sun advertisment consistent update
81740b8 Wi-sun bootstarp update nad balck list trace level update
6919ba1 Wi-sun New key index activate.
0aead93 Wi-sun Probe functionality revert operation
4ff02f9 Stop sending normal ACK if neighbour is Unknown.
c387fda NS Probe limiter accept only 2 probe at 16 seconds period.
a58c71b Trace level updates (ARMmbed#2247)
6867dd7 Suplicant EAP-TLS timeout is not incremented from retries
1f1c2a2 Test purpose change.
1b99fe1 Added ETX to rpl_possible_better_candidate
3441594 RPL parent candidate list update
96ffe92 Adaptation layer to support multiple simultaneous unicast transmissions (ARMmbed#2243)
45f8519 On stop (ifdown) stores frame counters regardless of threshold
5c2fc55 Corrected frame counter handling on re-discovery
9307416 Added check to prevent installing new GTK to used index using GKH
385ae14 WS bootstrap: print MAC address
2b1dfb9 Slaac address can be recreated after root stop
74ff3cc Merge branch 'release_internal' into release_external
66bfd98 Fixed trace printing warnings.
21d9c24 DHCP server address allocated pointer init fix.
e659a01 Fixed compile warning for may uninitialized usage.
cee8502 Fixed trace printing warnings.
bc9f07b DHCP server address allocated pointer init fix.
e3fddad Fixed compile warning for may uninitialized usage.
bf909d2 Modified bbr restart mechanism when dodagid was lost

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: fb7413b
artokin pushed a commit to artokin/mbed-os that referenced this pull request Feb 21, 2020
…..fb7413b

fb7413b Merge branch 'release_internal' into release_external
a9f6e88 Merge branch 'master' into release_internal
c536960 DHCPv6 Server feature update
01e7e82 Merge pull request ARMmbed#2314 from ARMmbed/update_from_mbedos
c906c43 Fixed typo: 'lenght' in ns_crc.h
2bd0558 Wi-sun border router DHCPv6 server address alocation update
63e4680 Allow buffer_dyn to handle more data (ARMmbed#2311)
9b82abf Copy IE unicast channel function from WS info instead of FHSS configu… (ARMmbed#2310)
18247d5 Wi-sun RPL memory soft and hard limit update
c8560db Updated RPL default memory sof and hard limit to 2/4 from 1/2.
05aa54c Update MPL parameters to follow Specification
f728d55 Support for handle CRC error which will automatically change a channel.
6b6f535 Corrected EUI-64 address bit flip on supplicant
015f3fe Corrected bitfield definition
7717ef8 Improved initial EAPOL-key send stop logic on supplicant
4185734 Improved EAPOL key update retry logic
8bda176 Wi-sun boot fix
6283dfd DIO advertisment fix
1acec7c Aro Registation and Dao update
6cde17a Iotthd 3963 2 (ARMmbed#2301)
b9187da Randomize fixed channel when making new parent selection
34d0339 Wi-sun address registartion update
5b30559 Allow unicast TX to overlap with MC (ARMmbed#2298)
d40b1c7 MAC: Updated calling FHSS TX done (ARMmbed#2295)
aeb93a1 Add support for bbr configuration that removes default route from DIO
9b941af Use default UC channel function in discovery, fixed BC schedule (ARMmbed#2284)
d65fcc6 Fix Wi-SUN network name comparison (ARMmbed#2294)
f085132 Made parent set size configuraple in RPL
fd11ffa Added HAVE_WS flag to FHSS api (ARMmbed#2296)
4f27500 Implemented optimal packet size test api (ARMmbed#2292)
87ee16a Call channel change after filtered out packet
d196ffc Refactor Wi-SUN BBR stop function
35970d7 Revert "Disabled temporarily tx slot check for testing purposes (ARMmbed#2287)" (ARMmbed#2289)
8cc0ff5 Disabled temporarily tx slot check for testing purposes (ARMmbed#2287)
e306dc5 Removed extra ";"
5642a4f Free TX failed list when FHSS deleted (ARMmbed#2285)
9fcf718 Updated FHSS optimal packet length to 300 bytes (ARMmbed#2282)
427743f ETX and Source route validation update
7b6bcca Added TX/RX bytes in PHY statistics (ARMmbed#2281)
a043f8d Wi-sun FHSS Management update
2ff90e6 Configure TXRX slot length using given datarate (ARMmbed#2275)
a126cb7 ETX sampling rule update
d5cf8d5 Clean ARMC6/GCC compiler warnings (ARMmbed#2278)
807632d DHCP server freed next free allocated id
fd6ce04 Thread Child ml16 update clear old address queue's and registered address.
99e6efa Neighbour remove operation update
5cd094c Corrected GTK update initial EAPOL-key trickle timer
7606ee8 Wi-sun NS Aro registration blacklisting update
e3e5a00 Timed parent selection timer trigger update
7144121 RPL DIO Multicast message update
588f202 Wi-Sun RPL bootstrap update
20289f6 Added periodic RPL version number increase
d8dd18d Added ignoring of incoming security messages and improved EAP-TLS startup
7350634 Corrected initial EAPOL-key trickle retries
ac33518 Wi-sun ETX and proping update
11c486f Implemented unregistering FHSS from MAC. FHSS deleted in ifdown call. (ARMmbed#2266)
eabca17 Wi-Sun Border router DHCPV server SLAAC mode enabled by default.
1d6ce9c DHCPv6 Server feature update
46aa460 Fixed unit test's.
c65292e Mac enhanced ACK pending update
11a1e1d Store TX start channel and black list if TX failed (ARMmbed#2261)
0494606 Adapatation layer unicast list entry free update
4481e86 Updated trace level to info.
c9e3d8e Interface down update
1f77ad6 Updated trace levels (ARMmbed#2258)
1d82fd5 Wi-sun BBR route update fix
33c48eb Removed NUD messages from registered children
ec2ea92 Added RX and TX active times in PHY statistics (ARMmbed#2255)
49686cc Wi-sun certification test setup update
1090430 Trickle API update and Wi-SUN config sol state timeout update
38df576 Wi-sun advertisment consistent update
81740b8 Wi-sun bootstarp update nad balck list trace level update
6919ba1 Wi-sun New key index activate.
0aead93 Wi-sun Probe functionality revert operation
4ff02f9 Stop sending normal ACK if neighbour is Unknown.
c387fda NS Probe limiter accept only 2 probe at 16 seconds period.
a58c71b Trace level updates (ARMmbed#2247)
6867dd7 Suplicant EAP-TLS timeout is not incremented from retries
1f1c2a2 Test purpose change.
1b99fe1 Added ETX to rpl_possible_better_candidate
3441594 RPL parent candidate list update
96ffe92 Adaptation layer to support multiple simultaneous unicast transmissions (ARMmbed#2243)
45f8519 On stop (ifdown) stores frame counters regardless of threshold
5c2fc55 Corrected frame counter handling on re-discovery
9307416 Added check to prevent installing new GTK to used index using GKH
385ae14 WS bootstrap: print MAC address
2b1dfb9 Slaac address can be recreated after root stop
74ff3cc Merge branch 'release_internal' into release_external
66bfd98 Fixed trace printing warnings.
21d9c24 DHCP server address allocated pointer init fix.
e659a01 Fixed compile warning for may uninitialized usage.
cee8502 Fixed trace printing warnings.
bc9f07b DHCP server address allocated pointer init fix.
e3fddad Fixed compile warning for may uninitialized usage.
bf909d2 Modified bbr restart mechanism when dodagid was lost

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: fb7413b
artokin pushed a commit to artokin/mbed-os that referenced this pull request Feb 26, 2020
…..fb7413b

fb7413b Merge branch 'release_internal' into release_external
a9f6e88 Merge branch 'master' into release_internal
c536960 DHCPv6 Server feature update
01e7e82 Merge pull request ARMmbed#2314 from ARMmbed/update_from_mbedos
c906c43 Fixed typo: 'lenght' in ns_crc.h
2bd0558 Wi-sun border router DHCPv6 server address alocation update
63e4680 Allow buffer_dyn to handle more data (ARMmbed#2311)
9b82abf Copy IE unicast channel function from WS info instead of FHSS configu… (ARMmbed#2310)
18247d5 Wi-sun RPL memory soft and hard limit update
c8560db Updated RPL default memory sof and hard limit to 2/4 from 1/2.
05aa54c Update MPL parameters to follow Specification
f728d55 Support for handle CRC error which will automatically change a channel.
6b6f535 Corrected EUI-64 address bit flip on supplicant
015f3fe Corrected bitfield definition
7717ef8 Improved initial EAPOL-key send stop logic on supplicant
4185734 Improved EAPOL key update retry logic
8bda176 Wi-sun boot fix
6283dfd DIO advertisment fix
1acec7c Aro Registation and Dao update
6cde17a Iotthd 3963 2 (ARMmbed#2301)
b9187da Randomize fixed channel when making new parent selection
34d0339 Wi-sun address registartion update
5b30559 Allow unicast TX to overlap with MC (ARMmbed#2298)
d40b1c7 MAC: Updated calling FHSS TX done (ARMmbed#2295)
aeb93a1 Add support for bbr configuration that removes default route from DIO
9b941af Use default UC channel function in discovery, fixed BC schedule (ARMmbed#2284)
d65fcc6 Fix Wi-SUN network name comparison (ARMmbed#2294)
f085132 Made parent set size configuraple in RPL
fd11ffa Added HAVE_WS flag to FHSS api (ARMmbed#2296)
4f27500 Implemented optimal packet size test api (ARMmbed#2292)
87ee16a Call channel change after filtered out packet
d196ffc Refactor Wi-SUN BBR stop function
35970d7 Revert "Disabled temporarily tx slot check for testing purposes (ARMmbed#2287)" (ARMmbed#2289)
8cc0ff5 Disabled temporarily tx slot check for testing purposes (ARMmbed#2287)
e306dc5 Removed extra ";"
5642a4f Free TX failed list when FHSS deleted (ARMmbed#2285)
9fcf718 Updated FHSS optimal packet length to 300 bytes (ARMmbed#2282)
427743f ETX and Source route validation update
7b6bcca Added TX/RX bytes in PHY statistics (ARMmbed#2281)
a043f8d Wi-sun FHSS Management update
2ff90e6 Configure TXRX slot length using given datarate (ARMmbed#2275)
a126cb7 ETX sampling rule update
d5cf8d5 Clean ARMC6/GCC compiler warnings (ARMmbed#2278)
807632d DHCP server freed next free allocated id
fd6ce04 Thread Child ml16 update clear old address queue's and registered address.
99e6efa Neighbour remove operation update
5cd094c Corrected GTK update initial EAPOL-key trickle timer
7606ee8 Wi-sun NS Aro registration blacklisting update
e3e5a00 Timed parent selection timer trigger update
7144121 RPL DIO Multicast message update
588f202 Wi-Sun RPL bootstrap update
20289f6 Added periodic RPL version number increase
d8dd18d Added ignoring of incoming security messages and improved EAP-TLS startup
7350634 Corrected initial EAPOL-key trickle retries
ac33518 Wi-sun ETX and proping update
11c486f Implemented unregistering FHSS from MAC. FHSS deleted in ifdown call. (ARMmbed#2266)
eabca17 Wi-Sun Border router DHCPV server SLAAC mode enabled by default.
1d6ce9c DHCPv6 Server feature update
46aa460 Fixed unit test's.
c65292e Mac enhanced ACK pending update
11a1e1d Store TX start channel and black list if TX failed (ARMmbed#2261)
0494606 Adapatation layer unicast list entry free update
4481e86 Updated trace level to info.
c9e3d8e Interface down update
1f77ad6 Updated trace levels (ARMmbed#2258)
1d82fd5 Wi-sun BBR route update fix
33c48eb Removed NUD messages from registered children
ec2ea92 Added RX and TX active times in PHY statistics (ARMmbed#2255)
49686cc Wi-sun certification test setup update
1090430 Trickle API update and Wi-SUN config sol state timeout update
38df576 Wi-sun advertisment consistent update
81740b8 Wi-sun bootstarp update nad balck list trace level update
6919ba1 Wi-sun New key index activate.
0aead93 Wi-sun Probe functionality revert operation
4ff02f9 Stop sending normal ACK if neighbour is Unknown.
c387fda NS Probe limiter accept only 2 probe at 16 seconds period.
a58c71b Trace level updates (ARMmbed#2247)
6867dd7 Suplicant EAP-TLS timeout is not incremented from retries
1f1c2a2 Test purpose change.
1b99fe1 Added ETX to rpl_possible_better_candidate
3441594 RPL parent candidate list update
96ffe92 Adaptation layer to support multiple simultaneous unicast transmissions (ARMmbed#2243)
45f8519 On stop (ifdown) stores frame counters regardless of threshold
5c2fc55 Corrected frame counter handling on re-discovery
9307416 Added check to prevent installing new GTK to used index using GKH
385ae14 WS bootstrap: print MAC address
2b1dfb9 Slaac address can be recreated after root stop
74ff3cc Merge branch 'release_internal' into release_external
66bfd98 Fixed trace printing warnings.
21d9c24 DHCP server address allocated pointer init fix.
e659a01 Fixed compile warning for may uninitialized usage.
cee8502 Fixed trace printing warnings.
bc9f07b DHCP server address allocated pointer init fix.
e3fddad Fixed compile warning for may uninitialized usage.
bf909d2 Modified bbr restart mechanism when dodagid was lost

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: fb7413b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants